package com.bright.ghj.overt.constant;

import com.bright.ghj.overt.pojo.dto.FilelistCwgkFooterDto;
import com.bright.ghj.overt.pojo.po.primary.FilelistCwgkFooter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author hxj
 * @Date 2024/1/4 20:24
 * @Description 公开常量
 */
public class PublicConstant {

    // 列表种类
    /**
     * 录入
     */
    public final static int LIST_TYPE_EDIT = 1;

    /**
     * 审核
     */
    public final static int LIST_TYPE_AUDIT = 2;

    /**
     * 发布
     */
    public final static int LIST_TYPE_PUBLISH = 3;

    // 业务类型
    /**
     * 财务
     */
    public final static Integer GK_TYPE_CW = 101;

    /**
     * 党务
     */
    public final static Integer GK_TYPE_DW = 102;

    /**
     * 事务
     */
    public final static Integer GK_TYPE_SW = 103;

    // 流程操作类型
    public final static String FLOW_TYPE_AUDIT = "审核";
    public final static String FLOW_TYPE_NOT_AUDIT = "取消审核";
    public final static String FLOW_TYPE_PUBLISH = "发布";
    public final static String FLOW_TYPE_NOT_PUBLISH = "取消发布";

    public final static String NOT_EDIT_ENABLE_MESSAGE = "数据已完成审核或只能由财务转入，不允许修改，操作取消！";

    public final static Map<Integer, String> GK_TYPE_MAP = new HashMap<>(3);

    // 脚注通用配置key 关联配置表filelist_cwgk_footer的fileName
    public final static String FOOTER_CONFIG_COMMON_KEY = "common";

    // 默认脚注
    public final static List<FilelistCwgkFooterDto> DEFAULT_FOOTER_LIST = new ArrayList<>(5);
    // 脚注key
    public final static String DWFZR_KEY = "dwfzr", KJXM_KEY = "kjxm", CNXM_KEY = "cnxm", JDXZ_KEY = "jdxz", CWFZR_KEY = "cwfzr";

    static {
        GK_TYPE_MAP.put(GK_TYPE_CW, "财务");
        GK_TYPE_MAP.put(GK_TYPE_DW, "党务");
        GK_TYPE_MAP.put(GK_TYPE_SW, "事务");

        DEFAULT_FOOTER_LIST.add(new FilelistCwgkFooterDto(null, DWFZR_KEY, "单位负责人", true, DWFZR_KEY, null));
        DEFAULT_FOOTER_LIST.add(new FilelistCwgkFooterDto(null, KJXM_KEY, "会计", true, KJXM_KEY, null));
        DEFAULT_FOOTER_LIST.add(new FilelistCwgkFooterDto(null, CNXM_KEY, "出纳", true, CNXM_KEY, null));
        DEFAULT_FOOTER_LIST.add(new FilelistCwgkFooterDto(null, JDXZ_KEY, "监督小组", true, JDXZ_KEY, null));
        DEFAULT_FOOTER_LIST.add(new FilelistCwgkFooterDto(null, CWFZR_KEY, "财务负责人", true, CWFZR_KEY, null));
    }

}
